<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    
    <meta http-equiv="content-language" content="zh-CN" />
    

    
    <meta name="viewport" content="width=device-width, initial-scale=0.5">
    

    
    <title>R语言文件目录相关操作</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.8/clipboard.min.js"></script>
    
    
    
    
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css">

    
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css">

    <link rel="stylesheet" href="/css/stylesheet.css">
    <link rel="stylesheet" href="/css/home.css">

    
    
        <style type="text/css">
        body { background-color: #fbf6ec;}
        </style>
    
    
                
        
        
            <link rel="stylesheet" href="/css/main.css"/>
        




        
        
        
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/styles/github.min.css"  />
         
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/highlight.min.js"></script>
        
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/r.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/yaml.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/latex.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/matlab.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/mathematica.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/julia.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/julia-repl.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/powershell.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/bash.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/shell.min.js"></script>
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.3.2/languages/python.min.js"></script>
        
        <script>hljs.initHighlightingOnLoad();</script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
          
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" integrity="sha512-+4zCK9k+qNFUR5X+cKL9EIR+ZOhtIloNl9GIKS57V1MyNsYpYcUrUeQc9vNfzsWfV28IaLL3i96P9sdNyeRssA==" crossorigin="anonymous" />
     
     
</head>


<body>
    <script>
        window.addEventListener("resize", resizeThrottler, false);

        var resizeTimeout;
        function resizeThrottler() {
        
        if ( !resizeTimeout ) {
            resizeTimeout = setTimeout(function() {
            resizeTimeout = null;
            actualResizeHandler();
        
            
            }, 66);
        }
        }
        actualResizeHandler()
        function actualResizeHandler() {
                if (/mobile/i.test(navigator.userAgent) || /android/i.test(navigator.userAgent))
                {
                    document.body.classList.add('mobile');
                }else{
                    document.body.classList.remove('mobile');  
                }
    }</script>

    
      
      
            <nav class="navbar navbar-default navbar-static-top" style="opacity: .9" role="navigation">
        <div class="container-fluid">
            
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">

                    <span class="sr-only">Toggle navigation</span>
                    <span class="big-icon icon-bar"></span>
                    <span class="big-icon icon-bar"></span>
                    <span class="big-icon icon-bar"></span>

                </button>
                <a class="navbar-brand" href="/">zsc</a>
            </div>

            <div class="navbar-collapse collapse" id="bs-example-navbar-collapse-1" style="height: auto;">
                <ul class="nav navbar-nav navbar-right" style="font-size: 100%">
                    
                        
                            
                            <li class=""><a href="/about/">About</a></li>
                            
                            <li class=""><a href="/categories/">Categories</a></li>
                            
                            <li class=""><a href="/">Home</a></li>
                            
                            <li class=""><a href="/tags/">Tags</a></li>
                            
                            <li class=""><a href="/issue/">存在的问题</a></li>
                            
                        
                    
                </ul>
            </div>
        </div>
    </nav>










<div class="inner">
    



    <div class="blog-post">
        
                <div>
            <h2 align="center" id = "singe-h2">
                R语言文件目录相关操作
                <time>
                    <br>
                    <span> 
                        <i class="fa fa-user-edit" style="color:#888;font-size: 80%;"></i>
                        zsc 
                    </span>
                    &nbsp 
                    <span>                 
                        <i class="fa fa-calendar-alt" style="color:#888;font-size: 80%;"></i>
                        2017-04-08 
                    </span>
                </time>
                
                
                <div>
                    <ul class="tags">
                        
                        <span>标签:</span>
                        <li><a class="link" href="/tags/r"> #r </a></li>
                        
                        <span> </span>
                        
                    </ul>
                    
                </div>
            </h2>
        </div>
    
        
        <section id="content">
            <h2 id="1-文件系统介绍">1. 文件系统介绍</h2>
<p>R语言对文件系统的操作，包括文件操作和目录操作，函数API都定义在base包中。</p>
<h2 id="2-目录操作">2. 目录操作</h2>
<p><strong>2.1 查看目录</strong></p>
<p>查看当前目录下的子目录。</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span> <span style="color:#a6e22e">setwd</span>()               <span style="color:#75715e">#设定某个目录为当前目录</span>
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">getwd</span>()               <span style="color:#75715e"># 当前的目录</span>
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">list.dirs</span>()           <span style="color:#75715e"># 查看当前目录的子目录  参数详见dir()</span>
</span></span><span style="display:flex;"><span> 
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">dir</span>()                 <span style="color:#75715e">#查看当前目录的子目录和文件。</span>
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">dir</span>(path<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;C:/windows&#34;</span>)<span style="color:#75715e">#查看指定目录的子目录和文件</span>
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">dir</span>(path<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;C:/windows&#34;</span>,all.files<span style="color:#f92672">=</span><span style="color:#66d9ef">TRUE</span>)<span style="color:#75715e"># 列出目录下所有的目录和文件，包括隐藏文件</span>
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">dir</span>(path<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;C:/windows&#34;</span>,pattern<span style="color:#f92672">=</span><span style="color:#e6db74">&#39;^R&#39;</span>)<span style="color:#75715e">#只列出以字母R开头的子目录或文件</span>
</span></span><span style="display:flex;"><span> 
</span></span><span style="display:flex;"><span> <span style="color:#a6e22e">file.info</span>(<span style="color:#e6db74">&#34;.&#34;</span>)         <span style="color:#75715e"># 查看当前目录权限</span>
</span></span></code></pre></div><p><strong>2.2 创建目录</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span><span style="color:#a6e22e">dir.create</span>(<span style="color:#e6db74">&#34;your dir&#34;</span>)        <span style="color:#75715e"># 在当前目录下，新建一个目录</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">dir.create</span>(path<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;a1/b2/c3&#34;</span>,recursive <span style="color:#f92672">=</span> <span style="color:#66d9ef">TRUE</span>)  <span style="color:#75715e">#递归创建一个3级子目录./a1/b2/c3，直接创建会出错</span>
</span></span></code></pre></div><p><strong>2.3 检查目录是否存在</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span><span style="color:#a6e22e">system</span>(<span style="color:#e6db74">&#34;tree&#34;</span>)                      <span style="color:#75715e"># 通过系统命令查看目录结构</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">file.exists</span>(<span style="color:#e6db74">&#34;./a1&#34;</span>)             <span style="color:#75715e"># 查看某个目录是否存在,可以多层次调用目录</span>
</span></span></code></pre></div><p><strong>2.4 检查目录的权限</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span>df<span style="color:#f92672">&lt;-</span><span style="color:#a6e22e">dir</span>(full.names <span style="color:#f92672">=</span> <span style="color:#66d9ef">TRUE</span>)         <span style="color:#75715e">#获取当前目录的所有目录(不含子目录)和文件名（含后缀）</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">file.access</span>(df, model<span style="color:#f92672">=</span><span style="color:#ae81ff">0</span>) <span style="color:#f92672">==</span> <span style="color:#ae81ff">0</span>      <span style="color:#75715e"># 检查文件或目录是否存在，mode=0</span>
</span></span><span style="display:flex;"><span>         						  <span style="color:#75715e"># 检查文件或目录是否可执行，mode=1，目录为可以执行</span>
</span></span><span style="display:flex;"><span>         						  <span style="color:#75715e"># 检查文件或目录是否可写，mode=2</span>
</span></span><span style="display:flex;"><span>          						 <span style="color:#75715e"># 检查文件或目录是否可读，mode=4</span>
</span></span></code></pre></div><p><strong>2.5修改目录权限。</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span> <span style="color:#a6e22e">Sys.chmod</span>(<span style="color:#e6db74">&#34;./create&#34;</span>, mode <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;0555&#34;</span>, use_umask <span style="color:#f92672">=</span> <span style="color:#66d9ef">TRUE</span>)  <span style="color:#75715e"># 修改目录权限，所有用户只读</span>
</span></span><span style="display:flex;"><span> 
</span></span></code></pre></div><p><strong>2.6 对目录重名</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span><span style="color:#a6e22e">file.rename</span>(<span style="color:#e6db74">&#34;create&#34;</span>, <span style="color:#e6db74">&#34;newcreate&#34;</span>)            <span style="color:#75715e"># 对tcreate目录重命名为newcreate</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">unlink</span>(<span style="color:#e6db74">&#34;newcreate&#34;</span>, recursive <span style="color:#f92672">=</span> <span style="color:#66d9ef">TRUE</span>)         <span style="color:#75715e"># 删除newcreate目录   递归删除</span>
</span></span></code></pre></div><p><strong>2.7 其他功能函数</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span><span style="color:#a6e22e">file.path</span>(<span style="color:#e6db74">&#34;p1&#34;</span>,<span style="color:#e6db74">&#34;p2&#34;</span>,<span style="color:#e6db74">&#34;p3&#34;</span>)                  <span style="color:#75715e"># 拼接目录字符串</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">dirname</span>(path<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;&#34;</span>)                           <span style="color:#75715e">#获得某个路径的目录名</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">basename</span>(path<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;&#34;</span>)                          <span style="color:#75715e">#获得某个目录的最底层目录或者文件名</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">normalizePath</span>(<span style="color:#a6e22e">c</span>(<span style="color:#a6e22e">R.home</span>(), <span style="color:#a6e22e">tempdir</span>()))      <span style="color:#75715e">#获取目录的绝对路径</span>
</span></span></code></pre></div><h2 id="3-文件操作">3. 文件操作</h2>
<p><strong>3.1 查看文件</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span><span style="color:#a6e22e">file.exists</span>(<span style="color:#e6db74">&#34;readme.txt&#34;</span>)         <span style="color:#75715e"># 检查文件是否存在</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">file.info</span>(<span style="color:#e6db74">&#34;readme.txt&#34;</span>)            <span style="color:#75715e"># 查看文件完整信息</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">file.access</span>(<span style="color:#e6db74">&#34;readme.txt&#34;</span>,<span style="color:#ae81ff">0</span>)        <span style="color:#75715e"># 查看文件访问权限，存在详情见2.4</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">file_test</span>(<span style="color:#e6db74">&#34;-d&#34;</span>, <span style="color:#e6db74">&#34;readme.txt&#34;</span>)      <span style="color:#75715e">#判断是文件还是目录。-d ,是目录返回ture</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">file_test</span>(<span style="color:#e6db74">&#34;-f&#34;</span>, <span style="color:#e6db74">&#34;readme.txt&#34;</span>)      <span style="color:#75715e"># 判断是否是文件 .  -f 是文件但会ture</span>
</span></span></code></pre></div><p><strong>3.2 创建文件</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span><span style="color:#a6e22e">file.create</span>(<span style="color:#e6db74">&#34;A.txt&#34;</span>)            <span style="color:#75715e"># 创建一个空文件 A.txt</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">cat</span>(<span style="color:#e6db74">&#34;file B\n&#34;</span>, file <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;B.txt&#34;</span>) <span style="color:#75715e"># 把相关的内容写入B.txt文件中，没有这个文件则创建文件并写入内容 </span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">readLines</span>(<span style="color:#e6db74">&#34;A.txt&#34;</span>)         <span style="color:#75715e"># 读取A.txt并打印</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">file.append</span>(<span style="color:#e6db74">&#34;A.txt&#34;</span>, <span style="color:#a6e22e">rep</span>(<span style="color:#e6db74">&#34;B.txt&#34;</span>, <span style="color:#ae81ff">10</span>))   <span style="color:#75715e"># 合并文件,把文件B.txt的内容，合并到 A.txt。</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">file.copy</span>(<span style="color:#e6db74">&#34;A.txt&#34;</span>, <span style="color:#e6db74">&#34;C.txt&#34;</span>)    <span style="color:#75715e">#把文件A.txt复制到文件C.txt ,文件复制</span>
</span></span></code></pre></div><p><strong>3.3 修改文件权限</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span><span style="color:#75715e"># 修改文件权限，创建者可读可写可执行，其他人无权限</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Sys.chmod</span>(<span style="color:#e6db74">&#34;A.txt&#34;</span>, mode <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;0700&#34;</span>, use_umask <span style="color:#f92672">=</span> <span style="color:#66d9ef">TRUE</span>)
</span></span></code></pre></div><p><strong>3.4 文件重命名</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span><span style="color:#a6e22e">file.rename</span>(<span style="color:#e6db74">&#34;A.txt&#34;</span>,<span style="color:#e6db74">&#34;AA.txt&#34;</span>)     <span style="color:#75715e"># 给文件A.txt重命名为AA.txt</span>
</span></span></code></pre></div><p><strong>3.5 删除文件</strong></p>
<p>有两个函数可以使用file.remove和unlink，其中unlink函数使用同删除目录操作是一样的。</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-R" data-lang="R"><span style="display:flex;"><span><span style="color:#a6e22e">file.remove</span>(<span style="color:#e6db74">&#34;A.txt&#34;</span>, <span style="color:#e6db74">&#34;B.txt&#34;</span>, <span style="color:#e6db74">&#34;C.txt&#34;</span>)      <span style="color:#75715e"># 删除文件</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">unlink</span>(<span style="color:#e6db74">&#34;readme.txt&#34;</span>)                   <span style="color:#75715e"># 删除文件</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">system</span>(<span style="color:#e6db74">&#34;ls -l&#34;</span>)            <span style="color:#75715e"># 查看目录文件</span>
</span></span></code></pre></div><h2 id="4-几个特殊的目录">4. 几个特殊的目录</h2>
<ul>
<li><code>R.home()</code> 查看R软件的相关目录</li>
<li><code>.Library</code> 查看R核心包的目录</li>
<li><code>.Library.site</code> 查看R核心包的目录和root用户安装包目录</li>
<li><code>.libPaths()</code> 查看R所有包的存放目录</li>
<li><code>system.file()</code> 查看指定包所在的目录</li>
</ul>
<p>参考：<a href="http://blog.fens.me/r-file-folder/">http://blog.fens.me/r-file-folder/</a></p>

        </section>
    </div>
    <br>
    
    




<span id="/md/2017-04-08-r%E4%B8%AD%E8%AF%AD%E8%A8%80%E6%96%87%E4%BB%B6%E7%9B%AE%E5%BD%95%E7%9B%B8%E5%85%B3%E6%93%8D%E4%BD%9C/" class="leancloud_visitors" data-flag-title="R语言文件目录相关操作">
  <span class="post-meta-item-text">文章总阅读量 </span>
  <span class="leancloud-visitors-count"><i class="leancloud-visitors-count"></i></span>次;
  <p></p>
</span>



    

    
    
    <button id="edit-button" class="icon-button" type="button" title="Fork and edit" aria-label="Fork and edit" aria-haspopup="true" aria-expanded="false" aria-controls="edit">
        <i class="fa fa-edit">编辑本文</i>
    </button>
    
    
    

    <br>
    <hr>
    <li style="float:left;list-style:none">
        
        <a class="previous" href="/md/2017-01-30-r%E8%AF%AD%E8%A8%80%E4%B8%8E%E5%8F%AF%E8%A7%86%E5%8C%96/"> 上一篇: R语言与可视化</a>
        
    </li>
    <li style="float:right;list-style:none">
        
        <a class="next" href="/md/2017-11-13-%E6%95%B0%E6%8D%AE%E9%9B%86%E5%88%92%E5%88%86/"> 下一篇: 数据集划分—-训练集和测试集方法</a>
        
    </li>
     
    
    <script src="/js/copyCode.js"></script>
    <script src="/js/tooltips.js"></script>
    
   
    <script>
    [].slice.call(document.querySelectorAll('table')).forEach(function(el) {
        var wrapper = document.createElement('div');
        wrapper.className = 'table-area';
        el.parentNode.insertBefore(wrapper, el);
        el.parentNode.removeChild(el);
        wrapper.appendChild(el);
        $("table").wrap("<div class='table-area'></div>");
    })
    </script>

    
<br>
<hr>


<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-111691389-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag() { dataLayer.push(arguments); }
  gtag('js', new Date());

  gtag('config', 'UA-111691389-1');
</script>




      
      
      

       
      
      
      <script>
              document.getElementById("edit-button").addEventListener("click", function () {
                  var editWindow = window.open("https:\/\/github.com\/zoushucai\/blogmmm/edit/master/content/md\/2017-04-08-R中语言文件目录相关操作.md");
              });</script>
      
          




<script>
  function resizeIframe(obj) {
    obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
  } 
</script>



    </style>
    <script type="text/javascript">
    function showdiv(){
        document.getElementById("divtocTableOfContents").style.display="block";
        document.getElementById("strHref").innerHTML="目录收起-";
        document.getElementById('divTableOfContents').style.width="22%";
        document.getElementById('divTableOfContents').style.height="55%";
        document.getElementById('divTableOfContents').style.top="25%";
        document.getElementById('divTableOfContents').style.bottom="5%";
        document.getElementById("strHref").href="javascript:hidediv()";
    }
    function hidediv(){
        document.getElementById("divtocTableOfContents").style.display="none";
        document.getElementById("strHref").innerHTML="目录展开+";
        document.getElementById("strHref").href="javascript:showdiv()";
        document.getElementById('divTableOfContents').style.width="10%";
        document.getElementById('divTableOfContents').style.height="5%";
    }
    </script>
</body>

</html>
</div> 







    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/mathtex-script-type.min.js" integrity="sha384-LJ2FmexL77rmGm6SIpxq7y+XA6bkLzGZEgCywzKOZG/ws4va9fUVu2neMjvc3zdv" crossorigin="anonymous"></script>

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css">
    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js"></script>
    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js"></script>
    <script>
        document.addEventListener("DOMContentLoaded", function() {
            renderMathInElement(document.body, {
            delimiters: [
                            {left: "$$", right: "$$", display: true},
                            {left: "$", right: "$", display: false},
                            {left: "\\(", right: "\\)", display: false},
                            {left: "\\[", right: "\\]", display: true}
                        ]
            });
        });
    </script>













<br>
<div class="inner">
              
            
          
          
  
          
  
  <div id="vcomments"></div>
  
  <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
  
  <script src='//unpkg.com/valine/dist/Valine.min.js'></script>
  <script type="text/javascript">
    new Valine({
        el: '#vcomments' ,
        appId: 'HfHPKPkLa0cBEDPcdBAHuqMv-gzGzoHsz',
        appKey: 'r5RJAasN8e0mB9sq6y9pEcX0',
        lang:'zh-CN',
        notify:  false , 
        verify:  false  ,
        avatar:'identicon', 
        placeholder: '说点什么吧...',
        visitor:  true 
    });
  </script>

</div>

<br>
<br>
<footer>
    <p style="float:right;margin-right: 5%;margin-top: 0%;">
        &copy; 2022 <a href="https://github.com/zoushucai">zsc</a>
      </p>
</footer>
<br>
<br>


